<?php include ('includes/header.php');?>
<?php include ('includes/db_connect.php');?>
<?php
	$sql = "SELECT * FROM categories";
	$query = mysql_query($sql);
?>
<br>
<br>
<a href="category_new.php" class="btn btn-primary">Add New Category</a>
<table class="table table-hover">
	<thead>
		<tr>
			<th>Category Name</th>
			<th>Action</th>
		</tr>
	</thead>
	<tbody>
		<?php while ($row = mysql_fetch_array($query)) { ?>
			<tr>
				<td><?php echo $row['name'] ?></td>
				<td>
					<a class="delete" href="categories_act.php?act=3&id=<?php echo $row['id']; ?>">Delete</a>
					<a href="category_edit.php?id=<?php echo $row['id']; ?>">Edit</a>
				</td>
			</tr>
		<?php } ?>
	</tbody>
</table>
<?php include ('includes/footer.php');?>